import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import layout from "../layout/index.vue";
const routerHistory = createWebHashHistory();
const routes: Array<RouteRecordRaw> = [
  {
    path: "/a",
    component: () => import("../simplePage/a/index.vue"),
    meta: {
      keepAlive: true,
    },
  },
  {
    path: "/home",
    component: layout,
    meta: {
      keepAlive: true,
      mark: "home",
    },
    children: [
      {
        path: "/home1",
        component: () => import("../simplePage/a/index.vue"),
        meta: {
          keepAlive: true,
          mark: "home1",
        },
      },
        {
          path: "/home2",
          component: () => import("../simplePage/b/index.vue"),
          meta: {
            keepAlive: true,
            mark: "home2",
          },
        },
    ],
  },
];
const router = createRouter({
  history: routerHistory,
  routes: routes,
});
router.afterEach((to, from) => {
    // to.meta.keepAlive = true
})
export default router;
